package com.cxc.beanutil.demo;

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

public class Test {



    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();


    }


    public User findById(Integer id) {
        UserVO vo = new UserVO();
//        User po = initPO(vo);
//        copyProperties(po, vo);

        try {
            return BeanConvertUtils.convertTo(initPO(vo),User::new);
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }

    private User initPO(UserVO vo) {
        User u = new User();
        u.setName("cxc");
        u.setAddress("浙江");
        u.setAge(34);
        u.setSex("男");

        return u;
    }

}
